package com.beiding.exception;

public class SimpleException extends RuntimeException {

    private String message;
    private String key;

    private SimpleException(String key) {
        this.key = key;
    }

    public SimpleException(String key, String message) {
        this.key =key;
        this.message=message;
    }

    public String getKey() {
        return key;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public static SimpleException of(String key){
        return new SimpleException(key);
    }

    public SimpleException message(String message){
        this.message = message;
        return this;
    }

}
